<script type="text/javascript">
$(function () {
	var url = '${contextPath}script/oa/vehicle.js';
	$.ajax({url:url, dataType:'script', cache:true,
		success: function(){
			
		}
	});
	$('#vtn').autocomplete(${(type)!'[]'}, {
		
		max: 12,    //列表里的条目数
		minChars: 0,    //自动完成激活之前填入的最小字符
		width: 220,     //提示的宽度，溢出隐藏
        scrollHeight: 300,   //提示的高度，溢出显示滚动条
        matchContains: true,    //包含匹配，就是data参数里的数据，是否只要包含文本框里的数据就显示
        autoFill: false,    //自动填充
        formatItem: function(row, i, max) {
      	  return i + '/' + max + ':"' + row.vtn + '"';
        },
        formatMatch: function(row, i, max) {
      	  return row.vtn + row.vtc;
        },
        formatResult: function(row) {
      	  return row.vtn;
		}
	}).result(function(event, row, formatted) {
		$('#vtc').val(row.vtc);
	});
});
</script>
<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte>
<div>
	<h3>编辑车辆信息</h3>
</div>
<div style="width:400px;float:left;">
	<div height="50">
		<form id="editVehicleForm">
			<table class="table table-bordered animate2 fadeInUp">
				<tr>
					<td class="table-left" style="width:80px;">车辆名称</td>
					<td>
						<input class="form-control" type="text" id="name" name="name" value="${(vehicle.name)!''}"/>
						<input  type="hidden" id="code" name="code" value="${(vehicle.code)!''}" />
					</td>
				</tr>
				<tr>
					<td class="table-left" style="width:60px;">车牌号</td>
					<td>
						<input class="form-control" type="text" id="plate" name="plate" value="${(vehicle.plate)!''}"/>
					</td>
				</tr>
				<tr>
					<td class="table-left" style="width:80px;">价格</td>
					<td>
						<input class="form-control" type="text" id="price" name="price" value="${(vehicle.price)!''}"/>
					</td>
				</tr>
				<tr>
	      		 	<td class="table-left">车辆类别</td>
					<td><input id="vtn" name="vtn" value="${(vehicle.vtn)!''}" type="text"/>
					<input id="vtc" name="vtc" value="${(vehicle.vtc)!''}" type="hidden"/>
				</td>
          		</tr>
				<tr height="40">
					<td colspan="2" style="text-align: center;">
						<a href="#" class="btn btn-info" onclick="javascript:save_vehicle(); return false;">
							<i class="icon-save"></i> &nbsp;保&nbsp;&nbsp;存
						</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="#" class="btn btn-primary" onclick="javascript: history.back(); return false;">
							<i class="fontello-icon-block"></i>&nbsp;取&nbsp;&nbsp;消
						</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>